import {_decorator, Component, Prefab, instantiate, sys} from 'cc';

const {ccclass, property} = _decorator;

@ccclass('Side')
export class Side extends Component {

    @property(Prefab)
    sidePrefab: Prefab = null

    onLoad(){
        if(sys.platform!=sys.Platform.BYTEDANCE_MINI_GAME){
            this.node.getChildByName('sideBtn').active = false
        }else{
            this.node.getChildByName('sideBtn').active = true
        }
    }

    click() {
        let side = instantiate(this.sidePrefab);
        side.parent = this.node;
        side.active = true;
    }
}


